import java.util.ArrayList;
import java.util.List;

/**
 * @author: gao
 * @create-date: 2025/3/2 11:23
 */

public class Test {
    public static void main(String[] args) {
        List<Integer> result = new ArrayList<>();
        Solution solution = new Solution();

        TreeNode root = new TreeNode(1,new TreeNode(2),new TreeNode(3));
        root.left.left = new TreeNode(4);
        root.left.right = new TreeNode(5);
        root.left.right.left = new TreeNode(6);
        root.left.right.right = new TreeNode(7);
        root.right.right = new TreeNode(8);
        root.right.right.left = new TreeNode(9);

        result = solution.preorderTraversal(root);
        System.out.println(result);
    }
}